﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AhCha.Fortunate.ModelsDto.Base
{
    /// <summary>
    /// 所有的QueryInput 都应该继承该类
    /// 统一管理 页码、大小字段名
    /// </summary>
    public class PageInputBase
    {
        /// <summary>
        /// 当前页码
        /// </summary>
        public virtual int PageIndex { get; set; } = 1;

        /// <summary>
        /// 页码容量
        /// </summary>
        public virtual int PageSize { get; set; } = 20;
    }

    /// <summary>
    /// EF Core 扩展分页实体
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    public class PageModel<TEntity>
    {

        /// <summary>
        /// 总行数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 数据
        /// </summary>
        public List<TEntity>? Rows { get; set; }

    }
}
